home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Commodities / BlocNotes / OpenNote.pvrx < prev    next >
Text File  |  1996-09-26  |  3KB  |  133 lines

  1. /* " Template, History and Information"
  2. ** $VER: OpenNote.pvrx 0.002 (08 Feb 1996)
  3. **
  4. ** c 1995 Perry Mowbray
  5. **    Landscape Imagery
  6. **
  7. ** NAME
  8. **    OpenNote.pvrx
  9. **
  10. ** FUNCTION
  11. **    Arexx-Script for ProVector.
  12. **
  13. **    Open Note associated WITH drawing (used BlocNotes)
  14. **
  15. **
  16. ** SYNOPSIS
  17. **
  18. **
  19. ** INPUTS
  20. **
  21. ** SUGGESTED "ProVector.pvrx" ENTRIES:
  22. **
  23. ** $HISTORY:
  24. **
  25. ** 08 Feb 1996 : 000.002 :  Creates a new note, IF not found
  26. ** 29 Jan 1996 : 000.001 :  Initial release
  27. **
  28. **
  29. */
  30.  
  31.  
  32. OPTIONS RESULTS                             /* enable return codes       */
  33.  
  34. if (LEFT(ADDRESS(), 9) ~= "ProVector") then /* not started by ProVector? */
  35.     ADDRESS 'ProVector'
  36.  
  37. 'LOCK'                                      /* lock GUI, gain access     */
  38. IF RC ~= 0 THEN EXIT
  39. OPTIONS FAILAT 6                            /* ignore warnings           */
  40. SIGNAL ON SYNTAX                            /* ensure clean exit         */
  41.  
  42.  
  43. /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
  44. ARG v
  45. title = "OpenNote.pvrx 0.002 (08 Feb 1996)"
  46. t = title
  47.  
  48. IF v = "?" THEN DO
  49.     l1 = "Opens Note associated with drawing (used BlocNotes)"
  50.     l2 = "c 1996 Perry Mowbray (Landscape Imagery)"
  51.     title = t
  52.     CALL esyntax
  53.     END
  54.  
  55.  
  56. IF Pos('blocnotes.rexx' , Show('Ports'))=0 THEN DO
  57.     l1 = "BlocNotes is not running"
  58.     l2 = ":("
  59.     title = t
  60.     CALL esyntax
  61. END
  62.  
  63. GetCurrProj;                Proj = RESULT
  64. ProjName    Proj;           pn = RESULT
  65.  
  66. sl = LastPos("/",pn)
  67. IF sl = 0 THEN sl = LastPos(":",pn)
  68. IF sl > 0 THEN pn = Right(pn,Length(pn)-sl)
  69.  
  70. IF Right(pn,5) = ".dr2d" THEN pn = Left(pn,Length(pn)-5)
  71.  
  72. 'UNLOCK'
  73.  
  74. ADDRESS 'blocnotes.rexx'
  75.  
  76. SEARCH pn
  77. id=result
  78. IF id=0 THEN DO
  79.    OPEN
  80.    id = RESULT
  81.    PRINT id pn
  82.    END
  83. ELSE SHOW id
  84.  
  85.  
  86. /* ---------------------------- END OF YOUR CODE --------------------- */
  87.  
  88. preend:
  89. 'UNLOCK' /* VERY important: unlock GUI */
  90. EXIT
  91.  
  92. SYNTAX:
  93.     ADDRESS 'ProVector'
  94.     l1="Sorry, error line " || SIGL
  95.     l2=ErrorText(RC) || " :-("
  96.     title = "Unforseen Error..."
  97. ESYNTAX:
  98.     tl=Max(Length(l1),Length(l2))+3
  99.     l1=centre(l1,tl)
  100.     l2=centre(l2,tl)
  101.     tw=(tl*8)+8
  102.     GetScreenFormat Screen
  103.     If Screen.UseWB="TRUE" then scrname="Workbench"
  104.       else scrname="PROVECTOR"
  105.     MyReq.PubScreen  = scrname
  106.     MyReq.0.LeftEdge = 50
  107.     MyReq.0.TopEdge  = 50
  108.     MyReq.0.Width    = tw
  109.     MyReq.0.Height   = 60
  110.     MyReq.0.Label    = title
  111.  
  112.     MyReq.1.LeftEdge = 8; MyReq.1.TopEdge = 8
  113.     MyReq.1.Width = 150; MyReq.1.Height = 16
  114.     MyReq.1.Type = Label
  115.     MyReq.1.Label = l1
  116.  
  117.     MyReq.2.LeftEdge = 8; MyReq.2.TopEdge = 24
  118.     MyReq.2.Width = 150; MyReq.2.Height = 16
  119.     MyReq.2.Type = Label
  120.     MyReq.2.Label = l2
  121.  
  122.     /* Set up the OK and CANCEL buttons */
  123.     MyReq.3.LeftEdge = (tw/2)-32; MyReq.3.TopEdge = 45
  124.     MyReq.3.Width = 64; MyReq.3.Height = 12
  125.     MyReq.3.Type = Button; MyReq.3.Label = "OK"; MyReq.3.EndGad = 1
  126.  
  127.     /* OK; now pop the requester up */
  128.     MyReq.NumGads = 4
  129.     address REXXREQUEST 'GetRequest MyReq' ; ROK=Result
  130.  
  131. CALL preend
  132.  
  133.